﻿using System;
using DevExpress.Xpo;

namespace CSY
{

    [NonPersistent]
    public class BaseObject : XPObject
    {
        public DateTime CreateDate;
        public DateTime UpdateDate;
        
        public BaseObject()
            : base()
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here.
        }

        public BaseObject(Session session)
            : base(session)
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here.
        }

        public override void AfterConstruction()
        {
            base.AfterConstruction();
            //this.CreateDate = DateTime.Now;
            //this.UpdateDate = DateTime.Now;
        }

        protected override void BeginEdit()
        {
            this.CreateDate = DateTime.Now;
            this.UpdateDate = DateTime.Now;
            base.BeginEdit();
        }
    }

}